/*
 * lib2Desa - Another 2D game library in C++
 * Copyright (C) 2009 Erivaldo Xavier de Lima Filho
 *
 * This program is free software and is distributed under GNU General Public License version 3. You can modify and/or redistribute
 * it under the terms of GPL version 3 or posterior version. This program comes with NO WARRANTY, for more details, see LICENSE,
 * or <http://www.gnu.org/licenses>.
 *
 * Contact info:
 *
 *	Erivaldo Xavier de Lima Filho, desadoc@gmail.com
 *
 */

#ifndef _RECT_HPP
#define _RECT_HPP

#include "Core/vector.hpp"

#ifndef _NO_NAMESPACE
namespace lib2Desa {
#endif

class Rect
{

private:

	vector2f pos;
	vector2f dim;

public:

	Rect(const vector2f& p = vector2f(), const vector2f& d = vector2f())
	: pos(p), dim(d)
	{
		// Nothing to do
	}

	const vector2f& position(void) const
	{
		return pos;
	}

	const vector2f& dimension(void) const
	{
		return dim;
	}

	f32 x(void) const
	{
		return pos[0];
	}

	f32 y(void) const
	{
		return pos[1];
	}

	f32 w(void) const
	{
		return dim[0];
	}

	f32 h(void) const
	{
		return dim[1];
	}

	f32 area(void) const
	{
		return dim[0]*dim[1];
	}
};


#ifndef _NO_NAMESPACE
}
#endif

#endif /*Rect.hpp included*/
